package com.uzai.common.enums;

/**
 * 微信群成员状态
 * @author lucher
 * @date 2018-02-08 15:37
 */
public enum WxgroupMemberStatusEnum {

    LEAVE(0,"离群"),
    NORMAL(1,"在群"),
    KICKED(2,"被踢"),
    BLACKLIST(3,"黑名单"),

    ;
    private Integer value;
    private String desc;
    WxgroupMemberStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    public Integer getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    public static WxgroupMemberStatusEnum getValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (WxgroupMemberStatusEnum type: WxgroupMemberStatusEnum.values()) {
            if (type.getValue() == value) {
                return type;
            }
        }
        return null;
    }
    public static String getDesc(Integer value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).getDesc();
    }
}
